import java.io.*;
import java.net.*;

public class urltest
{
 public static void main(String args[])
 {
  try
  {
   URL u1 = new URL("http://www.google.com/");
   BufferedReader br = new BufferedReader(
      new InputStreamReader(u1.openStream()));
   String s;
   
   while((s=br.readLine())!=null)
   {
    System.out.println(s);
   }
   
   br.close();
  }
  catch(MalformedURLException e)
   {
   System.out.println(e);
  }
  catch(IOException ee)
  {
   System.out.println(ee);
  }
  catch(Exception eee)
  {
   System.out.println(eee);
  }
 }
}
